#include <stdio.h>

#define ROW 5
#define COLUMN 5

int main()
{	   	       		 
    int a[ROW][COLUMN];
    int i, j, k;

    for (i = 0; i < ROW ; i++)
        for (j = 0; j < COLUMN ; j++ )
            a[i][j] = 5 * i + j + 1;  /*对矩阵赋值*/
    printf("转置前：\n");
    for (i = 0; i < ROW ; i++)
    {	   	       		 
        for (j = 0; j < COLUMN ; j++ )
            printf("%-4d", a[i][j]);         /*输出转置前的矩阵*/
        printf("\n");
    }
    printf("------------------\n");
    for (i = 0; i < ROW ; i++ )
    {	   	       		 
        for (j = 0; j < i ; j++ )
        {	   	       		 
            k = a[i][j];
            a[i][j] = a[j][i];
            a[j][i] = k;
        }
    }
    printf("转置后：\n");
    for (i = 0; i < ROW ; i++ )
    {	   	       		 
        for (j = 0; j < COLUMN ; j++ )
            printf("%-4d", a[i][j]);      /*输出后转置后的矩阵*/
        printf("\n");

    }
}